<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 600px;
            height: 200px;
            background-color: #f00;
        }
        p{
             /* 
      百分比单位 参考父元素的宽度或者高度！！ 
       */
        /* width: 50%; 
        height: 50%; */

      /* 
      vw view width 视口100vw等于视口的宽度
       */
      width: 50vw;
      height: 50vh;
      background-color: #272822;
        }
    </style>
</head>
<body>
    <div>
        <p></p>
    </div>
</body>
</html>